/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tools;

/**
 *
 * @author Marco
 */
public class Checker {

    public boolean isDigit(String priceS) {
        boolean isDigit = true, dot = false;
        char temp;
        for (int i = 0; i < priceS.length(); i++) {
            temp = priceS.charAt(i);
            if(!Character.isDigit(temp)){
                if(temp == '.'){
                    if(dot){
                        isDigit = false;
                    } else {
                        dot = true;
                    }                        
                } else {
                    isDigit = false;
                }
            }
        }
        return isDigit;
    }
    
}
